feat: add configurable pipeline logging#28
Conversation
Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
This pull request introduces configurable logging levels across the TypeX application, adding a settings UI in the desktop frontend, supporting dynamic log filter reloading in the desktop app, and introducing detailed debug logging for pipeline stages. The review feedback highlights two key improvements: initializing tracing before loading the configuration in the CLI to prevent losing startup logs, and deriving PartialEq and Eq on the new LogLevel enum to facilitate direct comparisons.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| let config = load_config()?; | ||
| init_tracing(config.logging.level); |
There was a problem hiding this comment.
The load_config() function is called before init_tracing(). Since load_config() contains tracing::info! calls to log whether the config was loaded or if the default config is being used, these log messages will be executed before the tracing subscriber is initialized. As a result, these startup logs will be completely lost and won't appear in the console.
To fix this, you can check if the config file exists and log the status in main immediately after init_tracing is initialized. You should also remove the tracing::info! calls from inside load_config() to keep the code clean.
| let config = load_config()?; | |
| init_tracing(config.logging.level); | |
| let config_path = std::path::Path::new("config.toml"); | |
| let config_exists = config_path.exists(); | |
| let config = load_config()?; | |
| init_tracing(config.logging.level); | |
| if config_exists { | |
| tracing::info!("loaded config from {}", config_path.display()); | |
| } else { | |
| tracing::info!("using default config"); | |
| } |
| pub level: LogLevel, | ||
| } | ||
|
|
||
| #[derive(Debug, Clone, Copy, Default, Serialize, Deserialize)] |
There was a problem hiding this comment.
The LogLevel enum is a simple configuration enum. It is highly recommended to derive PartialEq and Eq for such enums to allow direct comparison and equality checks in tests or other parts of the codebase without needing to convert them to strings first.
| #[derive(Debug, Clone, Copy, Default, Serialize, Deserialize)] | |
| #[derive(Debug, Clone, Copy, Default, Serialize, Deserialize, PartialEq, Eq)] |
Co-Authored-By: Claude <noreply@anthropic.com>
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces configurable and dynamic logging levels across the TypeX application. It adds a new logging configuration section to AppConfig with levels ranging from Error to Trace, exposes this setting in the desktop frontend UI with localized strings, and implements dynamic log level reloading in the desktop app using tracing_subscriber::reload. Additionally, it integrates detailed debug-level tracing throughout the text processing pipeline stages (ASR, plugins, LLM, and final output). There are no review comments to evaluate, so I have no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Summary
🤖 Generated with Claude Code